﻿//-----------------------------------------------------------------------
// <copyright file="Copyright.cs" author="Michael Herndon">
//     Copyright (c) Company.  All rights reserved.
// </copyright>
//-----------------------------------------------------------------------

namespace Amplify.CodeDom
{
	using System;
	using System.CodeDom;
	using System.Collections.Generic;
	using System.Linq;
	using System.Text;

	public static partial class Mixin
	{
		public static CodeAssignStatement ToSetValue(this CodeFieldReferenceExpression unit)
		{
			return new CodeAssignStatement(unit, new CodePropertySetValueReferenceExpression());
		}

		public static CodeAssignStatement ToEqual(this CodeFieldReferenceExpression unit, object value)
		{
			return new CodeAssignStatement(unit, new CodePrimitiveExpression(value));
		}

		public static CodeAssignStatement ToEqual(this CodePropertyReferenceExpression unit, object value)
		{
			return new CodeAssignStatement(unit, new CodePrimitiveExpression(value));
		}

		public static CodeAssignStatement ToEqual(this CodeVariableReferenceExpression unit, object value)
		{
			return new CodeAssignStatement(unit, new CodePrimitiveExpression(value));
		}



		public static CodeAssignStatement ToEqual(this CodeFieldReferenceExpression unit, CodeExpression rightExpression)
		{
			return new CodeAssignStatement(unit, rightExpression);
		}

		public static CodeAssignStatement ToEqual(this CodePropertyReferenceExpression unit, CodeExpression rightExpression)
		{
			return new CodeAssignStatement(unit, rightExpression);
		}

		public static CodeAssignStatement ToEqual(this CodeVariableReferenceExpression unit, CodeExpression rightExpression)
		{
			return new CodeAssignStatement(unit, rightExpression);
		}
	}

	public class Assign : CodeAssignStatement 
	{

		public static CodeVariableReferenceExpression Var(string variableName)
		{
			return new CodeVariableReferenceExpression(variableName);
		}

		public static CodeThisReferenceExpression This
		{
			get { return new CodeThisReferenceExpression(); }
		}

	}
}
